package de.fmaul.dicheck.model;

import java.util.Iterator;
import java.util.List;

public class DataTable implements Iterable<DataRow> {
    private final List<DataRow> rows;
    private final DataTableMetaData metaData;

    public DataTable(DataTableMetaData metaData, List<DataRow> rows) {
        this.metaData = metaData;
        this.rows = rows;
    }

    public DataTableMetaData getMetaData() {
        return metaData;
    }

    public boolean isDataAvailable() {
        return (rows.size() > 0);
    }

    public List<DataRow> getRows() {
        return rows;
    }

    public Iterator<DataRow> iterator() {
        return rows.iterator();
    }

}
